using System;
using System.Data;
using System.Collections.Generic;
namespace eTMS.DAO{
	/********************************BEGIN MenusDAOBase****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:12/09/2010 36:08:02</para>
	/// <para>Class Name: MenusDAOBase</para>
	/// <para>Description: Class access to table Menus in database. Coder should'nt code here.</para>
	///</summary>

	
	public abstract class MenusDAOBase : ADOBase.DAOBase<MenusEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: Menu_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int Menu_ID){
			string strSQL="SELECT  [Menu_ID],[MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex] FROM [Menus]  WHERE [Menus].[Menu_ID]=@Menu_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@Menu_ID",Menu_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: Menu_ID</para>
		/// <para>Output: MenusEntity</para>
		///</summary>
		public MenusEntity SelectOne(int Menu_ID){
			IDbCommand cmd=this.CreateSelectOneCommand(Menu_ID);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [Menu_ID],[MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex] FROM [Menus] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [Menu_ID],[MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex] FROM [Menus]  WHERE [Menus].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [Menu_ID],[MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex] FROM [Menus]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [Menu_ID],[MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex] FROM [Menus]  WHERE [Menus].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: MenusEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(MenusEntity o){
			string strSQL="INSERT INTO [Menus]([MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex]) VALUES  (@MenuName,@MenuTitle,@Icon,@URL,@Module_ID,@MenuParent_ID,@MenuIndex);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullMenuName)
				this.CreateCommandParameter(cmd,"@MenuName",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuName",o.MenuName);

			if(o.IsNullMenuTitle)
				this.CreateCommandParameter(cmd,"@MenuTitle",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuTitle",o.MenuTitle);

			if(o.IsNullIcon)
				this.CreateCommandParameter(cmd,"@Icon",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Icon",o.Icon);

			if(o.IsNullURL)
				this.CreateCommandParameter(cmd,"@URL",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@URL",o.URL);

			if(o.IsNullModule_ID)
				this.CreateCommandParameter(cmd,"@Module_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Module_ID",o.Module_ID);

			if(o.IsNullMenuParent_ID)
				this.CreateCommandParameter(cmd,"@MenuParent_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuParent_ID",o.MenuParent_ID);

			if(o.IsNullMenuIndex)
				this.CreateCommandParameter(cmd,"@MenuIndex",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuIndex",o.MenuIndex);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: Save</para>
		/// <para>Input: MenusEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(MenusEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.Menu_ID=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of MenusEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<MenusEntity>list){
			foreach(MenusEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: MenusEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(MenusEntity o){
			string strSQL="UPDATE  [Menus] SET [Menus].[MenuName]=@MenuName,[Menus].[MenuTitle]=@MenuTitle,[Menus].[Icon]=@Icon,[Menus].[URL]=@URL,[Menus].[Module_ID]=@Module_ID,[Menus].[MenuParent_ID]=@MenuParent_ID,[Menus].[MenuIndex]=@MenuIndex WHERE [Menus].[Menu_ID]=@Menu_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullMenu_ID)
				this.CreateCommandParameter(cmd,"@Menu_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Menu_ID",o.Menu_ID);

			if(o.IsNullMenuName)
				this.CreateCommandParameter(cmd,"@MenuName",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuName",o.MenuName);

			if(o.IsNullMenuTitle)
				this.CreateCommandParameter(cmd,"@MenuTitle",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuTitle",o.MenuTitle);

			if(o.IsNullIcon)
				this.CreateCommandParameter(cmd,"@Icon",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Icon",o.Icon);

			if(o.IsNullURL)
				this.CreateCommandParameter(cmd,"@URL",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@URL",o.URL);

			if(o.IsNullModule_ID)
				this.CreateCommandParameter(cmd,"@Module_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Module_ID",o.Module_ID);

			if(o.IsNullMenuParent_ID)
				this.CreateCommandParameter(cmd,"@MenuParent_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuParent_ID",o.MenuParent_ID);

			if(o.IsNullMenuIndex)
				this.CreateCommandParameter(cmd,"@MenuIndex",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MenuIndex",o.MenuIndex);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,Menu_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int Menu_ID){
			string strSQL="UPDATE  [Menus] SET [Menus].["+ColumnName+"]=@ColumnName WHERE [Menus].[Menu_ID]=@Menu_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@Menu_ID",Menu_ID);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: Update</para>
		/// <para>Input: MenusEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(MenusEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of MenusEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<MenusEntity>list){
			foreach(MenusEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateMenuName</para>
		/// <para>Input: NewMenuName,Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMenuName(string NewMenuName,int Menu_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MenuName",NewMenuName,Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateMenuTitle</para>
		/// <para>Input: NewMenuTitle,Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMenuTitle(string NewMenuTitle,int Menu_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MenuTitle",NewMenuTitle,Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateIcon</para>
		/// <para>Input: NewIcon,Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateIcon(string NewIcon,int Menu_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("Icon",NewIcon,Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateURL</para>
		/// <para>Input: NewURL,Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateURL(string NewURL,int Menu_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("URL",NewURL,Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateModule_ID</para>
		/// <para>Input: NewModule_ID,Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateModule_ID(int NewModule_ID,int Menu_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("Module_ID",NewModule_ID,Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateMenuParent_ID</para>
		/// <para>Input: NewMenuParent_ID,Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMenuParent_ID(int NewMenuParent_ID,int Menu_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MenuParent_ID",NewMenuParent_ID,Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: UpdateMenuIndex</para>
		/// <para>Input: NewMenuIndex,Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMenuIndex(int NewMenuIndex,int Menu_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MenuIndex",NewMenuIndex,Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [Menus]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: MenusEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(MenusEntity o){
			string strSQL="DELETE   FROM [Menus]   WHERE [Menus].[Menu_ID]=@Menu_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullMenu_ID)
				this.CreateCommandParameter(cmd,"@Menu_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Menu_ID",o.Menu_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: Menu_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int Menu_ID){
			string strSQL="DELETE   FROM [Menus]   WHERE [Menus].[Menu_ID]=@Menu_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@Menu_ID",Menu_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [Menus]   WHERE [Menus].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: Delete</para>
		/// <para>Input: MenusEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(MenusEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: Menu_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int Menu_ID){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(Menu_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to MenusModules functions
		#endregion

		#region Select join to Menus functions
		#endregion

		#region Select join to Modules functions
		#endregion

		#region Select,delete by Menu_ID functions
		#endregion

		#region Select,delete by Module_ID functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_ID</para>
		/// <para>Input: Module_ID</para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAllByModule_ID(int Module_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyCommand("Module_ID",Module_ID);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_ID</para>
		/// <para>Input: Module_ID</para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSByModule_ID(int Module_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyCommand("Module_ID",Module_ID);
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_ID</para>
		/// <para>Input: Module_ID</para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAllByModule_IDFilter(string strFilter,int Module_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyFilterCommand(strFilter,"Module_ID",Module_ID);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_ID</para>
		/// <para>Input: Module_ID</para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSByModule_IDFilter(string strFilter,int Module_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyFilterCommand(strFilter,"Module_ID",Module_ID);
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: DeleteByModule_ID</para>
		/// <para>Input: Module_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByModule_ID(int Module_ID){
			IDbCommand cmd=this.CreateDeleteByKeyCommand("Module_ID",Module_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select,delete by MenuParent_ID functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByMenuParent_ID</para>
		/// <para>Input: MenuParent_ID</para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAllByMenuParent_ID(int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyCommand("MenuParent_ID",MenuParent_ID);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByMenuParent_ID</para>
		/// <para>Input: MenuParent_ID</para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSByMenuParent_ID(int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyCommand("MenuParent_ID",MenuParent_ID);
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByMenuParent_ID</para>
		/// <para>Input: MenuParent_ID</para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAllByMenuParent_IDFilter(string strFilter,int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyFilterCommand(strFilter,"MenuParent_ID",MenuParent_ID);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByMenuParent_ID</para>
		/// <para>Input: MenuParent_ID</para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSByMenuParent_IDFilter(string strFilter,int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByKeyFilterCommand(strFilter,"MenuParent_ID",MenuParent_ID);
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: DeleteByMenuParent_ID</para>
		/// <para>Input: MenuParent_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByMenuParent_ID(int MenuParent_ID){
			IDbCommand cmd=this.CreateDeleteByKeyCommand("MenuParent_ID",MenuParent_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select,Delete by Module_IDMenuParent_ID
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateSelectByModule_IDMenuParent_IDCommand</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByModule_IDMenuParent_IDCommand(int Module_ID,int MenuParent_ID){
			string strSQL="SELECT  [Menu_ID],[MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex] FROM [Menus]  WHERE [Menus].[Module_ID]=@Module_ID AND [Menus].[MenuParent_ID]=@MenuParent_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@Module_ID",Module_ID);


			this.CreateCommandParameter(cmd,"@MenuParent_ID",MenuParent_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_IDMenuParent_ID</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAllByModule_IDMenuParent_ID(int Module_ID,int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByModule_IDMenuParent_IDCommand(Module_ID,MenuParent_ID);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_IDMenuParent_ID</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSByModule_IDMenuParent_ID(int Module_ID,int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByModule_IDMenuParent_IDCommand(Module_ID,MenuParent_ID);
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateSelectByModule_IDMenuParent_IDFilterCommand</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByModule_IDMenuParent_IDFilterCommand(string strFilter,int Module_ID,int MenuParent_ID){
			string strSQL="SELECT  [Menu_ID],[MenuName],[MenuTitle],[Icon],[URL],[Module_ID],[MenuParent_ID],[MenuIndex] FROM [Menus]  WHERE [Menus].[Module_ID]=@Module_ID AND [Menus].[MenuParent_ID]=@MenuParent_ID AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@Module_ID",Module_ID);


			this.CreateCommandParameter(cmd,"@MenuParent_ID",MenuParent_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_IDMenuParent_ID</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: List of MenusEntity</para>
		///</summary>
		public List<MenusEntity> SelectAllByModule_IDMenuParent_IDFilter(string strFilter,int Module_ID,int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByModule_IDMenuParent_IDFilterCommand(strFilter,Module_ID,MenuParent_ID);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: SelectAllByModule_IDMenuParent_ID</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSByModule_IDMenuParent_IDFilter(string strFilter,int Module_ID,int MenuParent_ID){
			IDbCommand cmd=this.CreateSelectAllByModule_IDMenuParent_IDFilterCommand(strFilter,Module_ID,MenuParent_ID);
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: CreateDeleteByModule_IDMenuParent_IDCommand</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByModule_IDMenuParent_IDCommand(int Module_ID,int MenuParent_ID){
			string strSQL="DELETE   FROM [Menus]   WHERE [Menus].[Module_ID]=@Module_ID AND [Menus].[MenuParent_ID]=@MenuParent_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@Module_ID",Module_ID);


			this.CreateCommandParameter(cmd,"@MenuParent_ID",MenuParent_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: DeleteByModule_IDMenuParent_ID</para>
		/// <para>Input: Module_ID,MenuParent_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByModule_IDMenuParent_ID(int Module_ID,int MenuParent_ID){
			IDbCommand cmd=this.CreateDeleteByModule_IDMenuParent_IDCommand(Module_ID,MenuParent_ID);
			bool result=false;
			result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:12/09/2010 36:08:02</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: MenusEntity</para>
		///</summary>
		protected override MenusEntity MapObject(IDataReader r){
			MenusEntity entity = new MenusEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("Menu_ID");
						if (!r.IsDBNull(ordinal)) entity.Menu_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MenuName");
						if (!r.IsDBNull(ordinal)) entity.MenuName = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MenuTitle");
						if (!r.IsDBNull(ordinal)) entity.MenuTitle = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("Icon");
						if (!r.IsDBNull(ordinal)) entity.Icon = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("URL");
						if (!r.IsDBNull(ordinal)) entity.URL = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("Module_ID");
						if (!r.IsDBNull(ordinal)) entity.Module_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MenuParent_ID");
						if (!r.IsDBNull(ordinal)) entity.MenuParent_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MenuIndex");
						if (!r.IsDBNull(ordinal)) entity.MenuIndex = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END MenusDAOBase*****************************************/
	/*****************************************************************************************************/
}

